﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Text;
using System.Windows.Data;

namespace SoftHelper.Tool
{
    /// <summary>
    /// 项目语言转换器
    /// </summary>
    public class ProjectLanguageConvert : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value != null)
            {
                switch (value.ToString())
                {
                    case "java":
                        return "\ue639";
                    case "cs":
                        return "\xe61a";
                    case "py":
                        return "\ue891";
                    case "xaml":
                        return "\xe942";
                    case "xml":
                        return "\xe610";
                    case "js":
                        return "\xe704";
                    case "php":
                        return "\xe67e";
                    case "cpp":
                        return "\xe61b";
                    case "gradle":
                        return "\xe62d";
                    case "md":
                        return "\xe7a1";
                    default:
                        return "\xe6f2";
                }
            }
            else
            {
                return "\xe6f2";
            }
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
